export const http =  (url,params) => {
    var baseUrl = 'https://api-hmugo-web.itheima.net/api/public/v1/';
    var token = wx.getStorageSync('token');
    console.log(token);
    return new Promise((resolve,reject)=>{
        wx.request({
            url:baseUrl+url,
            ...params,
            header:{
                'Authorization':'Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ1aWQiOjIzLCJpYXQiOjE1NjQ3MzAwNzksImV4cCI6MTAwMTU2NDczMDA3OH0.YPt-XeLnjV-_1ITaXGY2FhxmCe4NvXuRnRB8OMCfnPo'
            },
            success:(res)=>{
                resolve(res.data)
            },
            fail:(err)=>{
                reject(err);
            }
        })
    })
}
